home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / unix / rcs / upatch01 / part01
Encoding:
Internet Message Format  |  1992-04-28  |  8.0 KB

  1. Path: wuarchive!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i134: rcs patch - unofficial patch to revision control system diff, Part01/01
  5. Message-ID: <12133@xanth.cs.odu.edu>
  6. Date: 10 Apr 90 21:55:24 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: acs@pccuts.pcc.amdahl.com (Tony Sumrall)
  9. Lines: 257
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: acs@pccuts.pcc.amdahl.com (Tony Sumrall)
  15. Posting-number: Volume 90, Issue 134
  16. Archive-name: unix/rcs/upatch01/part01
  17.  
  18. [ The original sources were posted in 1989.  Check a comp.sources.amiga
  19.   archive site if you need them.  ...tad ]
  20.  
  21. This shell archive contains patches for the diff program associated with
  22. RCS for the Amiga (Fish disk 281, comp.sources.amiga postings v89i216
  23. through v89i229) and address 2 problems:
  24.  
  25. 1) an attempt to compare a file with a non-existent file would elicit an
  26.    error message with null text
  27. 2) if one or more of the arguments to diff was a device or an assigned
  28.    name, diff would use a / to separate filename components instead of
  29.    using a :.
  30.  
  31. To apply these patches:
  32.  
  33. * remove all lines above the first line beginning with #,
  34. * run through /bin/sh or a suitable unshar program,
  35. * copy the 2 resulting files to a directory containing the source for
  36.   diff,
  37. * using patch from Fish disk # 296 or patch version 2.0 from Fish disk
  38.   # 129, say:
  39.  
  40.        patch < amiga1.c.diffs           and then
  41.        patch < diff.c.diffs
  42.  
  43. * compile the new diff following the instructions which were packaged with
  44.   the original version.
  45.  
  46. I've been using diff with these patches applied for quite some time with
  47. no ill effects.
  48. --
  49. Tony Sumrall   responsible for VT100 2.9A (and 2.9 and 2.8a and 2.8 and...)
  50. acs@pccuts.pcc.amdahl.com <=> amdahl!pccuts!acs
  51.  
  52. [ Opinions expressed herein are the author's and should not be construed
  53.   to reflect the views of Amdahl Corp. ]
  54.  
  55. #!/bin/sh
  56. # This is a shell archive.  Remove anything before this line, then unpack
  57. # it by saving it into a file and typing "sh file".  To overwrite existing
  58. # files, type "sh file -c".  You can also feed this as standard input via
  59. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  60. # will see the following message at the end:
  61. #        "End of archive 1 (of 1)."
  62. # Contents:  amiga1.c.diffs diff.c.diffs
  63. # Wrapped by tadguy@xanth on Tue Apr 10 17:54:34 1990
  64. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  65. if test -f 'amiga1.c.diffs' -a "${1}" != "-c" ; then 
  66.   echo shar: Will not clobber existing file \"'amiga1.c.diffs'\"
  67. else
  68. echo shar: Extracting \"'amiga1.c.diffs'\" \(592 characters\)
  69. sed "s/^X//" >'amiga1.c.diffs' <<'END_OF_FILE'
  70. XIndex: amiga1.c
  71. X*** Oamiga1.c    Thu Mar 22 09:24:29 1990
  72. X--- amiga1.c    Thu Mar  8 21:52:50 1990
  73. X***************
  74. X*** 47,54 ****
  75. X      long l;
  76. X      struct FileInfoBlock *fp,*malloc();
  77. X  
  78. X!     if ((l=Lock(name, ACCESS_READ)) == 0)
  79. X          return(-1);
  80. X      fp = malloc(sizeof(struct FileInfoBlock));
  81. X      Examine(l, fp);
  82. X      buf->st_attr = fp->fib_Protection;
  83. X--- 47,56 ----
  84. X      long l;
  85. X      struct FileInfoBlock *fp,*malloc();
  86. X  
  87. X!     if ((l=Lock(name, ACCESS_READ)) == 0) {
  88. X!         errno = ENOENT;
  89. X          return(-1);
  90. X+     }
  91. X      fp = malloc(sizeof(struct FileInfoBlock));
  92. X      Examine(l, fp);
  93. X      buf->st_attr = fp->fib_Protection;
  94. END_OF_FILE
  95. if test 592 -ne `wc -c <'amiga1.c.diffs'`; then
  96.     echo shar: \"'amiga1.c.diffs'\" unpacked with wrong size!
  97. fi
  98. # end of 'amiga1.c.diffs'
  99. fi
  100. if test -f 'diff.c.diffs' -a "${1}" != "-c" ; then 
  101.   echo shar: Will not clobber existing file \"'diff.c.diffs'\"
  102. else
  103. echo shar: Extracting \"'diff.c.diffs'\" \(3571 characters\)
  104. sed "s/^X//" >'diff.c.diffs' <<'END_OF_FILE'
  105. XIndex: diff.c
  106. X*** Odiff.c    Thu Mar 22 09:24:29 1990
  107. X--- diff.c    Sun Mar 11 12:01:14 1990
  108. X***************
  109. X*** 378,386 ****
  110. X    if (name1 == 0)
  111. X      name1 = name0;
  112. X  
  113. X!   inf[0].name = dir0 == 0 ? name0 : concat (dir0, "/", name0);
  114. X!   inf[1].name = dir1 == 0 ? name1 : concat (dir1, "/", name1);
  115. X  
  116. X    /* Stat the files.  Record whether they are directories.
  117. X       Record in stat_result whether stat fails.  */
  118. X  
  119. X--- 378,413 ----
  120. X    if (name1 == 0)
  121. X      name1 = name0;
  122. X  
  123. X!   if(dir0 == 0)
  124. X!     inf[0].name = name0;
  125. X!   else
  126. X!     {
  127. X!       if(strrchr(dir0, '/'))
  128. X!     inf[0].name = concat(dir0, "/", name0);
  129. X!       else
  130. X!     {
  131. X!       if(*(dir0 + strlen(dir0) - 1) == ':')
  132. X!         inf[0].name = concat(dir0, "", name0);
  133. X!       else
  134. X!         inf[0].name = concat(dir0, "/", name0);
  135. X!     }
  136. X!     }
  137. X  
  138. X+   if(dir1 == 0)
  139. X+     inf[1].name = name1;
  140. X+   else
  141. X+     {
  142. X+       if(strrchr(dir1, '/'))
  143. X+     inf[1].name = concat(dir1, "/", name1);
  144. X+       else
  145. X+     {
  146. X+       if(*(dir1 + strlen(dir1) - 1) == ':')
  147. X+         inf[1].name = concat(dir1, "", name1);
  148. X+       else
  149. X+         inf[1].name = concat(dir1, "/", name1);
  150. X+     }
  151. X+     }
  152. X+ 
  153. X    /* Stat the files.  Record whether they are directories.
  154. X       Record in stat_result whether stat fails.  */
  155. X  
  156. X***************
  157. X*** 402,413 ****
  158. X            perror_with_name (filename);
  159. X            errorcount = 1;
  160. X          }
  161. X!       else
  162. X  #ifdef AMIGA
  163. X          inf[i].dir_p = (inf[i].stat.st_type > 0);
  164. X  #else
  165. X          inf[i].dir_p = (S_IFDIR == (inf[i].stat.st_mode & S_IFMT));
  166. X  #endif
  167. X      }
  168. X      }
  169. X  
  170. X--- 429,441 ----
  171. X            perror_with_name (filename);
  172. X            errorcount = 1;
  173. X          }
  174. X!       else {
  175. X  #ifdef AMIGA
  176. X          inf[i].dir_p = (inf[i].stat.st_type > 0);
  177. X  #else
  178. X          inf[i].dir_p = (S_IFDIR == (inf[i].stat.st_mode & S_IFMT));
  179. X  #endif
  180. X+       }
  181. X      }
  182. X      }
  183. X  
  184. X***************
  185. X*** 427,432 ****
  186. X--- 455,461 ----
  187. X  
  188. X    if (name0 == 0)
  189. X      inf[0].dir_p = inf[1].dir_p;
  190. X+ 
  191. X    if (name1 == 0)
  192. X      inf[1].dir_p = inf[0].dir_p;
  193. X  
  194. X***************
  195. X*** 495,504 ****
  196. X        int dir_arg = (inf[0].dir_p ? 0 : 1);
  197. X        int fnm_arg = (inf[0].dir_p ? 1 : 0);
  198. X        char *p = strrchr(inf[fnm_arg].name, '/');
  199. X!       char *filename = concat (inf[dir_arg].name,  "/",
  200. X!                    (p ? p+1 : inf[fnm_arg].name));
  201. X  
  202. X  #ifdef AMIGA
  203. X        inf[dir_arg].dir_p = (getfa(filename) == 1);
  204. X        if (!inf[dir_arg].dir_p)
  205. X          {
  206. X--- 524,549 ----
  207. X        int dir_arg = (inf[0].dir_p ? 0 : 1);
  208. X        int fnm_arg = (inf[0].dir_p ? 1 : 0);
  209. X        char *p = strrchr(inf[fnm_arg].name, '/');
  210. X!       char *filename;
  211. X  
  212. X  #ifdef AMIGA
  213. X+       char *tp = inf[dir_arg].name;
  214. X+       int term = (*(tp + strlen(tp) - 1) == ':' ? 1 : 0);
  215. X+ 
  216. X+       if(!p) {
  217. X+       /* inf[dir_arg].name ends with a ':', a '/' or neither.  If it
  218. X+       ** ends with ':' then simply concat otherwise separate with a '/'.
  219. X+       ** Note that we also have to find out if there is a separator in the
  220. X+       ** filename, too so we know where to copy FROM when we create the new
  221. X+       ** filename.
  222. X+       */
  223. X+       char *p1 = strrchr(inf[fnm_arg].name, ':');
  224. X+ 
  225. X+       filename = concat(inf[dir_arg].name, term ? "" : "/",
  226. X+                 p1 ? p1+1 : inf[fnm_arg].name);
  227. X+       } else
  228. X+       filename = concat (inf[dir_arg].name,  term ? "" : "/", p+1);
  229. X+             
  230. X        inf[dir_arg].dir_p = (getfa(filename) == 1);
  231. X        if (!inf[dir_arg].dir_p)
  232. X          {
  233. X***************
  234. X*** 521,526 ****
  235. X--- 566,573 ----
  236. X        val = 2;
  237. X      }
  238. X  #else
  239. X+       filename = concat (inf[dir_arg].name,  "/",
  240. X+              (p ? p+1 : inf[fnm_arg].name));
  241. X        inf[dir_arg].desc = open (filename, O_RDONLY, 0);
  242. X  
  243. X        if (0 > inf[dir_arg].desc)
  244. END_OF_FILE
  245. if test 3571 -ne `wc -c <'diff.c.diffs'`; then
  246.     echo shar: \"'diff.c.diffs'\" unpacked with wrong size!
  247. fi
  248. # end of 'diff.c.diffs'
  249. fi
  250. echo shar: End of archive 1 \(of 1\).
  251. cp /dev/null ark1isdone
  252. MISSING=""
  253. for I in 1 ; do
  254.     if test ! -f ark${I}isdone ; then
  255.     MISSING="${MISSING} ${I}"
  256.     fi
  257. done
  258. if test "${MISSING}" = "" ; then
  259.     echo You have the archive.
  260.     rm -f ark[1-9]isdone
  261. else
  262.     echo You still need to unpack the following archives:
  263.     echo "        " ${MISSING}
  264. fi
  265. ##  End of shell archive.
  266. exit 0
  267. -- 
  268. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  269. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  270. Post requests for sources, and general discussion to comp.sys.amiga.
  271.